Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define precisely how to marshal SubjectPublicKeyInfo structure in tls.md #358

Merged
merged 3 commits into from
Aug 23, 2021

Conversation

kpp
Copy link
Contributor

@kpp kpp commented Aug 3, 2021

This is a clarification how to marshal SubjectPublicKeyInfo according to the go implementation (https://github.com/libp2p/go-libp2p-tls/blob/7530faa07acbfc0aa918c072c2cb35d3c8d5d859/crypto.go#L143 and https://pkg.go.dev/crypto/x509#MarshalPKIXPublicKey).

Define precisely how to marshal SubjectPublicKeyInfo structure
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks @kpp for extending the docs. This kind of contribution is very much appreciated!

Any additional comments @marten-seemann? If not, I will merge here.

tls/tls.md Outdated Show resolved Hide resolved
Co-authored-by: Max Inden <mail@max-inden.de>
@marten-seemann
Copy link
Contributor

All that we do is marshal the public key: https://github.com/libp2p/go-libp2p-tls/blob/7530faa07acbfc0aa918c072c2cb35d3c8d5d859/crypto.go#L167-L174
I'm not sure if we need to say anything more than https://pkg.go.dev/crypto/x509#MarshalPKIXPublicKey says, as this seems to be the standard way of marshaling the key. I find spelling it out explicitly, as suggested in this PR, confusing, as it suggests that we're doing something non-standard here.

@kpp
Copy link
Contributor Author

kpp commented Aug 7, 2021

@marten-seemann Would it be better if I replace that statement with: "The public key is encoded as a SubjectPublicKeyInfo structure as described in RFC 5280, Section 4.1:"?

@marten-seemann
Copy link
Contributor

Would it be better if I replace that statement with: "The public key is encoded as a SubjectPublicKeyInfo structure as described in RFC 5280, Section 4.1:"?

Yes, I think referencing the RFC makes a lot of sense here.

@kpp
Copy link
Contributor Author

kpp commented Aug 17, 2021

Done. Sorry for the delay.

@mxinden
Copy link
Member

mxinden commented Aug 23, 2021

Friendly ping @marten-seemann.

@mxinden mxinden merged commit 7ee906d into libp2p:master Aug 23, 2021
@kpp kpp deleted the patch-1 branch August 23, 2021 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants